package k2_oop.p9_collection.demo01;

import java.util.Stack;

public class UseStack {
    public static void main(String[] args) {

        Stack<String> stack = new Stack<>();

        stack.push("a");
        stack.push("b");
        stack.push("c");
        stack.push("d");
        stack.push("e");

        System.out.println(stack);

        stack.pop();

        System.out.println(stack);

        stack.pop();
        stack.push("f");
        stack.push("g");
        System.out.println(stack.pop());

        System.out.println(stack);

        System.out.println(stack.peek());
    }
}
